!(function (global, $, _) {
    var SellOrderList = function (data) {
        this.data = data || {};
    };

    _.extend(SellOrderList, global.CommonList);

    SellOrderList.prototype.init = function (columns) {
        if (!_.GLOABURL) {
            throw new Error('全局常量 BASICURL[string] 不能为空');
        }
        if (!this.data.basicUrl) {
            throw new Error('参数 basicUrl[string] 不能为空');
        }
        var me = this;
        $("#dg").datagrid({
            url: _.GLOABURL + me.data.basicUrl + '/list.do',
            method: 'get',
            queryParams: this.listWithPara,
            toolbar: this.toolBarSelector,
            pagination: 'true',
            rownumbers: 'true',
            singleSelect: 'true',
            autoRowHeight: 'true',
            fitColumns: 'false',
            height: 350,
            columns: this.columns
        });
        $('#dg').datagrid('hideColumn', 'ID');
        $('#dg').datagrid('reload');
    };

    SellOrderList.prototype.updateCurrentPageData = function (data) {
        $('#dg').datagrid('loadData', data.rows);
    };

    SellOrderList.prototype.searchWithParam = function (parameter) {
        parameter = parameter || {};
        $("#dg").datagrid({
            queryParams: parameter
        })
    };

    global.SellOrderList = SellOrderList;
})(typeof window !== "undefined" ? window : this, jQuery, common);